package com.boyuan.serviceImpl;

import com.boyuan.mapper.ModuleMapper;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import pojo.Module;

import java.util.ArrayList;
import java.util.List;

public class ModuleShare {

    private ModuleMapper moduleMapper;
    @Before
    public void init() {
        ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
        moduleMapper= ac.getBean("moduleMapper", ModuleMapper.class);
        System.out.println(moduleMapper);
    }
    @Test
    public List<Module> selectList(){
        List<Module> moduleList=new ArrayList<Module>();
        moduleList=  moduleMapper.selectList(null);
        System.out.println(moduleList.size());
        return moduleList;
    }
}
